// middleware/auth.js
import { getUser } from "@/utils/auth";

export default function ({ route, redirect }) {
    // 黑名单 验证用户是否登录
    var blackList = [
        "/agency", 
        "/agency/order", 
        "/agency/orderCustom",
        "/agency/orderShow", 
        "/agency/enterpriseCertification",
        "/agency/contract", 
        "/agency/invoiceInfo", 
        "/agency/invoiceList",
        "/agency/accredit",
        "/agency/priceFiling", 
        "/agency/address", 
        "/agency/accountInfo" ,
        "/agency/message",
        "/agency/feedback",
        "/agency/wallet"
    ];

    if (blackList.indexOf(route.path) !== -1) {
        if (getUser() == null) {
            redirect('/memberCenter/login');
        }
    }
}
